<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        /* .blankBox {
            height: 110vh;
            background: lightgreen;
        }
        .aimBox {
            margin: 40px auto;
            width: 400px;
            height: 300px;
            background: tomato;
            border: 4px solid blue;
            animation: fadein ease-in;
            animation-timeline: view();
            animation-range: entry 0 cover 40%;
        }
        .blankBox2 {
            height: 30vh;
            background: lightcoral;
        }

        @keyframes fadein {
            from {
                opacity: 0;
                scale: 0.5;
            }
            to {
                opacity: 1;
                scale: 1;
            }
        } */

        .blankBox3 {
            height: 200vh;
            background: yellowgreen;
        }
        .process {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 2px;
            background: tomato;
            animation: progressLine linear;
            animation-timeline: scroll();
            animation-range: entry 0 cover 100%;
        }
        @keyframes progressLine {
            from {
                width: 0%;
            }
            to {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <!-- <div class="blankBox"></div>
    <div class="aimBox"></div>
    <div class="blankBox2"></div> -->
    <div class="blankBox3">
        <div class="process"></div>
    </div>
</body>
</html>